"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LogAddManager = void 0;
const AccountDao_1 = require("../account_server/dao/AccountDao");
const check_Day_Inteval = 1000 * 60 * 60 * 24; //1天检查一次
const check_HalfHour_Inteval = 1000 * 60 * 30; //30天检查一次
class LogAddManager {
    constructor() {
        this.last_check_day_time = 0;
        this.last_check_halfHour_time = 0;
    }
    checkDayLog(now) {
        this.checkAddDayLog(now);
        this.checkAddHalfHourLog(now);
    }
    checkAddDayLog(now) {
        if (now - this.last_check_day_time >= check_Day_Inteval) {
            let date = new Date();
            // Logger.log("checkAddDayLog=", date.getHours())
            if (date.getHours() == 0) { //你见过半夜5点的篮球吗？
                this.last_check_day_time = now;
                // Daily_ResourceDao.insert_daily_resource()
            }
        }
    }
    checkAddHalfHourLog(now) {
        if (now - this.last_check_halfHour_time >= check_HalfHour_Inteval) {
            let date = new Date();
            // if (date.getMinutes() % 30 == 0) { //半小时搞一次
            this.last_check_halfHour_time = now;
            AccountDao_1.AccountDao.checkAddDailyLogin(date);
            AccountDao_1.AccountDao.checkAddDailyRegister(date);
            // }
        }
    }
}
exports.LogAddManager = LogAddManager;
LogAddManager.instance = new LogAddManager();
